<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="pages"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<s:set name="longDateFormat"><s:text name="dateformat.long" /></s:set>

<c:forEach items="${revisions}" var="revision">

	<!-- Created -->
	<c:if test="${revision.lastEntity == null}">
		<div class="contentBox info">
			<div class="contentBoxHeader">&nbsp;</div>
			<div class="contentBoxContent">
				<div class="contentBoxContentIcon">&nbsp;</div>
				<div class="contentBoxContentText">
					<span class="username">${revision.revisionEntity.modifiedBy.userName}</span>
					<span class="date"><fmt:formatDate value="${revision.revisionEntity.dateTime}" pattern="${longDateFormat}" /></span>
					<span class="content">
						<b><s:text name="created" /></b><br />
						<s:set name="statusLabel">${revision.entity.status.label}</s:set>
						<s:text name="status" />:
	 					<s:text name="%{statusLabel}" />
					</span>
				</div>			
				<div class="globalWrap">&nbsp;</div>
			</div>
			<div class="contentBoxFooter">&nbsp;</div>
		</div>
	</c:if>

	<!-- Status modified -->
	<c:if test="${revision.lastEntity != null && revision.entity.status.id != revision.lastEntity.status.id}">
		<div class="contentBox info">
			<div class="contentBoxHeader">&nbsp;</div>
			<div class="contentBoxContent">
				<div class="contentBoxContentIcon">&nbsp;</div>
				<div class="contentBoxContentText">
					<span class="username">${revision.revisionEntity.modifiedBy.userName}</span>
					<span class="date"><fmt:formatDate value="${revision.revisionEntity.dateTime}" pattern="${longDateFormat}" /></span>
					<span class="content">
						<b><s:text name="modified" /></b><br />
						<s:set name="statusLabel">${revision.entity.status.label}</s:set>
						<s:text name="status" />:
	 					<s:text name="%{statusLabel}" />
					</span>
				</div>			
				<div class="globalWrap">&nbsp;</div>
			</div>
			<div class="contentBoxFooter">&nbsp;</div>
		</div>
	</c:if>

	<!-- Comment added -->
	<c:if test="${revision.lastEntity != null && revision.entity.lastComment.id != revision.lastEntity.lastComment.id}">
		<div class="contentBox comment">
			<div class="contentBoxHeader">&nbsp;</div>
			<div class="contentBoxContent">
				<div class="contentBoxContentIcon">&nbsp;</div>
				<div class="contentBoxContentText">
					<span class="username">${revision.revisionEntity.modifiedBy.userName}</span>
					<span class="date"><fmt:formatDate value="${revision.revisionEntity.dateTime}" pattern="${longDateFormat}" /></span>
					<span class="content">
						<b><s:text name="newComment" /></b><br />
						${revision.entity.lastComment.comment}
					</span>
				</div>			
				<div class="globalWrap">&nbsp;</div>
			</div>
			<div class="contentBoxFooter">&nbsp;</div>
		</div>
	</c:if>
</c:forEach>


